package com.example.spring_boot;

import config.EnableTestConfig;
import config.MyImpostSelector;
import config.TestConfig1;
import config.TestConfig2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Import;

@SpringBootApplication
//@ComponentScan("config")//扫描此路径
//@Import(TestConfig.class)
//@Import({TestConfig1.class, TestConfig2.class})
//@Import(MyImpostSelector.class)
@EnableTestConfig
public class Application {
    public static void main(String[] args) {
        ApplicationContext applicationContext = SpringApplication.run(Application.class, args);
        TestConfig1 bean = applicationContext.getBean(TestConfig1.class);
        bean.test();
        TestConfig2 bean1 = applicationContext.getBean(TestConfig2.class);
        bean1.test();
    }

}
